package exception;

import java.util.Scanner;

public class customException {

    private static final String Name="小熊";

    private static final int  Password=12345;

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入用户名:");
        String username=scanner.nextLine();
        System.out.println("请输入密码:");
        int password=scanner.nextInt();
        if (!Name.equals(username)){
            throw new UserNameException("用户名错误！！！");
        }
        if (Password!=password){
            throw new PaswordException("密码输入错误！！！");
        }

    }
}

class UserNameException extends RuntimeException{
    public UserNameException(String msg){
        super();
    }
}

class PaswordException extends RuntimeException{
    public PaswordException(String msg){
        super();
    }

}